home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / strlib.zip / STRCAT.C < prev    next >
Text File  |  1993-01-04  |  768b  |  29 lines

  1.  
  2. /*  File   : strcat.c
  3.     Author : Richard A. O'Keefe.
  4.     Updated: 10 April 1984
  5.     Defines: strcat()
  6.  
  7.     strcat(s, t) concatenates t on the end of s.  There  had  better  be
  8.     enough  room  in  the  space s points to; strcat has no way to tell.
  9.     Note that strcat has to search for the end of s, so if you are doing
  10.     a lot of concatenating it may be better to use strmov, e.g.
  11.         strmov(strmov(strmov(strmov(s,a),b),c),d)
  12.     rather than
  13.         strcat(strcat(strcat(strcpy(s,a),b),c),d).
  14.     strcat returns the old value of s.
  15. */
  16.  
  17. #include "strings.h"
  18.  
  19. char *strcat(s, t)
  20.     register char *s, *t;
  21.     {
  22.         char *save;
  23.  
  24.         for (save = s; *s++; ) ;
  25.         for (--s; *s++ = *t++; ) ;
  26.         return save;
  27.     }
  28.  
  29.